home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / addflo / data1.cab / Program_Executable_Files / AddFlow / Samples / Demo / Workflow.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-05-06  |  11.7 KB  |  366 lines

  1. VERSION 4.00
  2. Begin VB.Form frmWorkflow 
  3.    Appearance      =   0  'Flat
  4.    BackColor       =   &H00FFFFFF&
  5.    Caption         =   "Example 1: WorkFlow"
  6.    ClientHeight    =   3675
  7.    ClientLeft      =   450
  8.    ClientTop       =   1530
  9.    ClientWidth     =   5445
  10.    FillColor       =   &H0080FFFF&
  11.    BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  12.       Name            =   "MS Sans Serif"
  13.       Size            =   8.25
  14.       Charset         =   0
  15.       Weight          =   700
  16.       Underline       =   0   'False
  17.       Italic          =   0   'False
  18.       Strikethrough   =   0   'False
  19.    EndProperty
  20.    ForeColor       =   &H80000008&
  21.    Height          =   4080
  22.    Left            =   390
  23.    LinkTopic       =   "Form1"
  24.    MDIChild        =   -1  'True
  25.    ScaleHeight     =   3675
  26.    ScaleWidth      =   5445
  27.    Tag             =   "1"
  28.    Top             =   1185
  29.    Width           =   5565
  30.    Begin VB.PictureBox Picture9 
  31.       Appearance      =   0  'Flat
  32.       BackColor       =   &H80000005&
  33.       ForeColor       =   &H80000008&
  34.       Height          =   585
  35.       Left            =   3540
  36.       Picture         =   "Workflow.frx":0000
  37.       ScaleHeight     =   555
  38.       ScaleWidth      =   555
  39.       TabIndex        =   2
  40.       Top             =   90
  41.       Visible         =   0   'False
  42.       Width           =   585
  43.    End
  44.    Begin VB.PictureBox Picture11 
  45.       Appearance      =   0  'Flat
  46.       BackColor       =   &H80000005&
  47.       ForeColor       =   &H80000008&
  48.       Height          =   585
  49.       Left            =   4770
  50.       Picture         =   "Workflow.frx":030A
  51.       ScaleHeight     =   555
  52.       ScaleWidth      =   585
  53.       TabIndex        =   1
  54.       Top             =   90
  55.       Visible         =   0   'False
  56.       Width           =   615
  57.    End
  58.    Begin VB.PictureBox Picture10 
  59.       Appearance      =   0  'Flat
  60.       BackColor       =   &H80000005&
  61.       ForeColor       =   &H80000008&
  62.       Height          =   585
  63.       Left            =   4140
  64.       Picture         =   "Workflow.frx":0614
  65.       ScaleHeight     =   555
  66.       ScaleWidth      =   585
  67.       TabIndex        =   0
  68.       Top             =   90
  69.       Visible         =   0   'False
  70.       Width           =   615
  71.    End
  72.    Begin AddFlowLib.AddFlow AddFlow1 
  73.       Height          =   3405
  74.       Left            =   270
  75.       TabIndex        =   3
  76.       Top             =   180
  77.       Width           =   3270
  78.       _Version        =   65536
  79.       _ExtentX        =   5768
  80.       _ExtentY        =   6006
  81.       _StockProps     =   101
  82.       BackColor       =   16777152
  83.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  84.          Name            =   "Arial"
  85.          Size            =   8.25
  86.          Charset         =   0
  87.          Weight          =   400
  88.          Underline       =   0   'False
  89.          Italic          =   0   'False
  90.          Strikethrough   =   0   'False
  91.       EndProperty
  92.       BorderStyle     =   1
  93.       ScrollBars      =   3
  94.       Shape           =   0
  95.       LinkStyle       =   0
  96.       Alignment       =   7
  97.       AutoSize        =   0
  98.       ArrowDst        =   3
  99.       ArrowOrg        =   0
  100.       DrawStyle       =   0
  101.       DrawWidth       =   1,4013e-45
  102.       ReadOnly        =   0   'False
  103.       MultiSel        =   -1  'True
  104.       CanDrawNode     =   -1  'True
  105.       CanDrawLink     =   -1  'True
  106.       CanMoveNode     =   -1  'True
  107.       CanSizeNode     =   -1  'True
  108.       CanStretchLink  =   -1  'True
  109.       CanMultiLink    =   -1  'True
  110.       Transparent     =   0   'False
  111.       ShowGrid        =   0   'False
  112.       Hidden          =   0   'False
  113.       Rigid           =   0   'False
  114.       DisplayHandles  =   -1  'True
  115.       AutoScroll      =   -1  'True
  116.       xGrid           =   7,00649e-45
  117.       yGrid           =   7,00649e-45
  118.       xZoom           =   100
  119.       yZoom           =   100
  120.       FillColor       =   16777215
  121.       DrawColor       =   0
  122.       ForeColor       =   0
  123.       BackPicture     =   "Workflow.frx":091E
  124.    End
  125. Attribute VB_Name = "frmWorkflow"
  126. Attribute VB_Creatable = False
  127. Attribute VB_Exposed = False
  128. Option Explicit
  129. Sub CursorShape(AddFlow1 As Control)
  130.   With AddFlow1
  131.     Dim area%
  132.     area = .PointedArea
  133.     Select Case area
  134.     Case 0
  135.       .MousePointer = 8
  136.     Case 1
  137.       .MousePointer = 7
  138.     Case 2
  139.       .MousePointer = 6
  140.     Case 3
  141.       .MousePointer = 9
  142.     Case 7
  143.       If .SelectMode = True Then
  144.         .MousePointer = 2
  145.       Else
  146.         .MousePointer = 0
  147.       End If
  148.     End Select
  149.   End With
  150. End Sub
  151. Private Sub AddFlow1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  152.   Me.SetFocus
  153. End Sub
  154. Private Sub AddFlow1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  155.   Dim nodx As afNode
  156.   If AddFlow1.LastUserAction() = 1 Then  ' Node creation
  157.     Set nodx = AddFlow1.SelectedNode
  158.     If Not (nodx Is Nothing) Then
  159.       nodx.UserData = 2
  160.     End If
  161.   End If
  162. End Sub
  163. Private Sub Form_Activate()
  164.   frmMain.ActivateForm
  165. End Sub
  166. Private Sub Form_Deactivate()
  167.   frmMain.DeactivateForm
  168. End Sub
  169. Private Sub Form_Load()
  170.   frmMain.ShowExample(0).Enabled = False
  171.   Dim nodx As afNode, lnkx As afLink
  172.   Dim crlf$
  173.   crlf = Chr$(13) + Chr$(10)
  174.   With AddFlow1
  175.     .Left = 0
  176.     .Top = 0
  177.     ' Just to accelerate display (Don't forget to reset it at the end)
  178.     .Repaint = False
  179.     .DrawColor = 32768
  180.     ' Create nodes
  181.     Set nodx = .Nodes.Add(1050, 60, 1300, 960)    ' Node 1
  182.     nodx.FillColor = RGB(255, 255, 192)
  183.     nodx.Text = "Order Entry"
  184.     Set nodx.Picture = Picture11.Picture
  185.     Set nodx = .Nodes.Add(1470, 1570, 450, 450)  ' Node 2
  186.     nodx.FillColor = 16777215
  187.     nodx.Text = "and"
  188.     Set nodx = .Nodes.Add(1425, 4815, 415, 480)  ' Node 3
  189.     nodx.FillColor = 16777215
  190.     Set nodx = .Nodes.Add(100, 3285, 1115, 525)  ' Node 4
  191.     nodx.Shape = afRoundRect
  192.     nodx.FillColor = 8454143
  193.     nodx.Text = "Inventory Check"
  194.     Set nodx = .Nodes.Add(2070, 2700, 1275, 465) ' Node 5
  195.     nodx.Shape = afRoundRect
  196.     nodx.FillColor = 8454143
  197.     nodx.Text = "Compile Reference"
  198.     Set nodx = .Nodes.Add(2070, 3960, 1275, 435) ' Node 6
  199.     nodx.Shape = afRoundRect
  200.     nodx.FillColor = 8454143
  201.     nodx.Text = "Evaluate Reference"
  202.     Set nodx = .Nodes.Add(2460, 4800, 480, 480) ' Node 7
  203.     nodx.Shape = afDiamond
  204.     nodx.FillColor = 12632256
  205.     nodx.Text = "or"
  206.     Set nodx = .Nodes.Add(1380, 6390, 480, 480)  ' Node 8
  207.     nodx.Shape = afDiamond
  208.     nodx.FillColor = 12632256
  209.     nodx.Text = "or"
  210.     Set nodx = .Nodes.Add(1050, 5620, 1150, 530)  ' Node 9
  211.     nodx.Shape = afRoundRect
  212.     nodx.FillColor = 8454143
  213.     nodx.Text = "Order Evaluation"
  214.     Set nodx = .Nodes.Add(30, 7275, 1365, 915)    ' Node 10
  215.     nodx.Shape = afRoundRect
  216.     nodx.FillColor = 8454143
  217.     nodx.Text = "Letter of regret"
  218.     Set nodx.Picture = Picture9.Picture
  219.     Set nodx = .Nodes.Add(2010, 7425, 1185, 390)  ' Node 11
  220.     nodx.Shape = afRoundRect
  221.     nodx.FillColor = 8454143
  222.     nodx.Text = "Billing"
  223.     Set nodx = .Nodes.Add(2025, 8310, 1170, 375)  ' Node 12
  224.     nodx.Shape = afRoundRect
  225.     nodx.FillColor = 8454143
  226.     nodx.Text = "Shipping"
  227.     Set nodx = .Nodes.Add(1380, 10005, 1110, 915) ' Node 13
  228.     nodx.DrawColor = 32768
  229.     nodx.FillColor = RGB(255, 255, 192)
  230.     nodx.Text = "Archive"
  231.     Set nodx.Picture = Picture10.Picture
  232.     .Shape = afRoundRect
  233.     .DrawColor = RGB(0, 0, 0)
  234.     Set nodx = .Nodes.Add(45, 1135, 1215, 640)    ' Node 14
  235.     nodx.Transparent = -1
  236.     nodx.UserData = 2
  237.     nodx.FillColor = 15269887
  238.     nodx.Text = "Jane" + crlf + "INVENTORY MANAGER"
  239.     Set nodx = .Nodes.Add(3000, 610, 1075, 525)    ' Node 15
  240.     nodx.Transparent = -1
  241.     nodx.UserData = 2
  242.     nodx.FillColor = 15269887
  243.     nodx.Text = "Paul" + crlf + "SECRETARY"
  244.     Set nodx = .Nodes.Add(3000, 5640, 1100, 480)    ' Node 16
  245.     nodx.Transparent = -1
  246.     nodx.UserData = 2
  247.     nodx.FillColor = 15269887
  248.     nodx.Text = "Lydia" + crlf + "SECRETARY"
  249.     Set nodx = .Nodes.Add(4000, 7770, 600, 540)   ' Node 17
  250.     nodx.DrawStyle = afDot
  251.     nodx.Transparent = -1
  252.     nodx.UserData = 2
  253.     nodx.FillColor = 15269887
  254.     nodx.Text = "Bill"
  255.     Set nodx = .Nodes.Add(105, 9030, 945, 600)    ' Node 18
  256.     nodx.Transparent = -1
  257.     nodx.UserData = 2
  258.     nodx.FillColor = 15269887
  259.     nodx.Text = "Jack" + crlf + "ARCHIVER"
  260.    .DrawColor = 32768
  261.     ' Create links
  262.     Set lnkx = .Nodes(1).OutLinks.Add(.Nodes(2))
  263.     Set lnkx = .Nodes(2).OutLinks.Add(.Nodes(4))
  264.     Dim pt As New afLinkPoint
  265.     pt.X = 795
  266.     pt.Y = 2130
  267.     lnkx.ExtraPoints.Add pt
  268.     Set lnkx = .Nodes(5).OutLinks.Add(.Nodes(6))
  269.     Set lnkx = .Nodes(4).OutLinks.Add(.Nodes(3))
  270.     pt.X = 795
  271.     pt.Y = 5040
  272.     lnkx.ExtraPoints.Add pt
  273.     Set lnkx = .Nodes(6).OutLinks.Add(.Nodes(7))
  274.     Set lnkx = .Nodes(7).OutLinks.Add(.Nodes(3))
  275.     lnkx.Text = "Yes"
  276.     Set lnkx = .Nodes(3).OutLinks.Add(.Nodes(9))
  277.     Set lnkx = .Nodes(9).OutLinks.Add(.Nodes(8))
  278.     Set lnkx = .Nodes(8).OutLinks.Add(.Nodes(10))
  279.     pt.X = 705
  280.     pt.Y = 6795
  281.     lnkx.ExtraPoints.Add pt
  282.     lnkx.Text = "Reject"
  283.     Set lnkx = .Nodes(8).OutLinks.Add(.Nodes(11))
  284.     pt.X = 2595
  285.     pt.Y = 6795
  286.     lnkx.ExtraPoints.Add pt
  287.     lnkx.Text = "Accept"
  288.     Set lnkx = .Nodes(11).OutLinks.Add(.Nodes(12))
  289.     Set lnkx = .Nodes(12).OutLinks.Add(.Nodes(13))
  290.     lnkx.DrawColor = 32768
  291.     Set lnkx = .Nodes(10).OutLinks.Add(.Nodes(13))
  292.     lnkx.DrawColor = 32768
  293.     Set lnkx = .Nodes(2).OutLinks.Add(.Nodes(5))
  294.     pt.X = 2700
  295.     pt.Y = 2115
  296.     lnkx.ExtraPoints.Add pt
  297.     Set lnkx = .Nodes(7).OutLinks.Add(.Nodes(5))
  298.     pt.X = 4020
  299.     pt.Y = 5040
  300.     lnkx.ExtraPoints.Add pt
  301.     pt.X = 4020
  302.     pt.Y = 2925
  303.     lnkx.ExtraPoints.Add pt
  304.     lnkx.Text = "No"
  305.     ' Default properties for the end
  306.     .DrawWidth = 1
  307.     .DrawColor = RGB(0, 0, 0)
  308.     .Shape = afRoundRect
  309.     .ArrowDst = afEmptyCircle
  310.     .ArrowOrg = afEmptyCircle
  311.     .Transparent = True
  312.     .LinkStyle = afBezier
  313.     ' Now continue
  314.     Set lnkx = .Nodes(14).OutLinks.Add(.Nodes(1))
  315.     Set lnkx = .Nodes(15).OutLinks.Add(.Nodes(5))
  316.     Set lnkx = .Nodes(15).OutLinks.Add(.Nodes(6))
  317.     pt.X = 4515
  318.     pt.Y = 2560
  319.     lnkx.ExtraPoints.Add pt
  320.     pt.X = 4200
  321.     pt.Y = 3000
  322.     lnkx.ExtraPoints.Add pt
  323.     Set lnkx = .Nodes(14).OutLinks.Add(.Nodes(4))
  324.     pt.X = 450
  325.     pt.Y = 2460
  326.     lnkx.ExtraPoints.Add pt
  327.     Set lnkx = .Nodes(16).OutLinks.Add(.Nodes(9))
  328.     Set lnkx = .Nodes(17).OutLinks.Add(.Nodes(11))
  329.     lnkx.DrawStyle = afDot
  330.     Set lnkx = .Nodes(17).OutLinks.Add(.Nodes(12))
  331.     lnkx.DrawStyle = afDot
  332.     Set lnkx = .Nodes(18).OutLinks.Add(.Nodes(10))
  333.     Set lnkx = .Nodes(18).OutLinks.Add(.Nodes(13))
  334.     .Repaint = True
  335.   End With
  336. End Sub
  337. Private Sub Form_Resize()
  338.   If WindowState <> 1 And ScaleHeight <> 0 Then
  339.     AddFlow1.Height = ScaleHeight
  340.     AddFlow1.Width = ScaleWidth
  341.   End If
  342. End Sub
  343. Private Sub Form_Unload(Cancel As Integer)
  344.   frmMain.ShowExample(0).Enabled = True
  345. End Sub
  346. Private Sub AddFlow1_DblClick()
  347.   Dim nodx As afNode, s$
  348.   Set nodx = AddFlow1.SelectedNode
  349.   If nodx Is Nothing Then Exit Sub
  350.   If nodx.UserData = 2 Then
  351.     s = frmTask.Display(nodx.Text)
  352.     If s <> "-1" Then   '!!
  353.       nodx.Text = s
  354.     End If
  355.   End If
  356. End Sub
  357. Private Sub AddFlow1_KeyDown(KeyCode As Integer, Shift As Integer)
  358.   Const KEY_DELETE = &H2E
  359.   If KeyCode = KEY_DELETE Then
  360.     AddFlow1.DeleteSel
  361.   End If
  362. End Sub
  363. Private Sub AddFlow1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  364.   CursorShape AddFlow1
  365. End Sub
  366.